<script setup lang="ts">
import type { QuDaoFanYongFenChengXiangQing } from '~/api/services/main.api.ts';

const props = defineProps<{
  commions: QuDaoFanYongFenChengXiangQing[];
}>();
</script>

<template>
  <table v-if="props.commions?.length" class="table__border-radius" v-bind="$attrs">
    <thead>
      <tr>
        <th>{{ $t('huIpHlrUe0Okx4tCxJy') }}</th>
        <th>{{ $t('2R1WqKav0vUQvUe6l0Vn') }}</th>
        <th>{{ $t('fMq6Dvhkec9M0IzRmbDrr') }}</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in commions" :key="item.category_id">
        <th>{{ item.game_name }}</th>
        <td>{{ bignumber(item.my_commissions).multipliedBy(item.coefficient).multipliedBy(100) }}%</td>
        <td>{{ bignumber(item.shares).multipliedBy(item.coefficient).multipliedBy(100) }}%</td>
      </tr>
    </tbody>
  </table>
</template>
